/*
 * Copyright 2015-2016 Imply Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { $, SortAction } from 'plywood';
import { Locale } from '../../common/utils/time/time';

export const TITLE_HEIGHT = 36;

// Core = filter + split
export const DIMENSION_HEIGHT = 27;
export const MEASURE_HEIGHT = 27;
export const CORE_ITEM_WIDTH = 192;
export const CORE_ITEM_GAP = 8;
export const BAR_TITLE_WIDTH = 66;

export const PIN_TITLE_HEIGHT = 36;
export const PIN_ITEM_HEIGHT = 25;
export const PIN_PADDING_BOTTOM = 12;
export const VIS_H_PADDING = 10;

export const VIS_SELECTOR_WIDTH = 79;
export const OVERFLOW_WIDTH = 40;

export const SPLIT = 'SPLIT';

export const MAX_SEARCH_LENGTH = 300;
export const SEARCH_WAIT = 900;

// Do not set an explicit type for STRINGS, let typescript figure it out and type check that we are using string correctly
export const STRINGS = {
  add: 'Add',
  addAttributes: 'Add attributes',
  addFromCube: 'Add from Cube',
  addNewCollection: 'Add new collection',
  addNewTile: 'Add new tile',
  addToCollection: 'Add to collection',
  addVisualization: 'Add tile',
  any: 'any',
  attribute: 'Attribute',
  attributes: 'attributes',
  autoFillDimensionsAndMeasures: 'Auto-fill dimensions and measures',
  autoUpdate: 'Auto update',
  cancel: 'Cancel',
  close: 'Close',
  collections: 'Collections',
  configureCluster: 'configure cluster',
  configureDataCube: 'configure data cube',
  connectNewCluster: 'Connect new cluster',
  contains: 'Contains',
  convertToFixedTime: 'Convert to fixed time',
  copySpecificUrl: 'Copy URL - fixed time',
  copyUrl: 'Copy URL',
  copyValue: 'Copy value',
  createDataCube: 'Create new cube',
  connectCluster: 'Connect new cluster',
  createDataCubesFromCluster: 'Create data cubes from cluster?',
  current: 'Current',
  create: 'Create',
  cubes: 'cubes',
  dataCubes: 'Data Cubes',
  dataSources: 'data sources',
  'delete': 'Delete',
  deleteCollection: 'Delete this collection',
  deleteCollectionTile: 'Delete this tile',
  dimensions: 'Dimensions',
  dimension: 'Dimension',
  download: 'Download',
  dragToReorder: 'Drag tiles to reorder',
  duplicateCollectionTile: 'Duplicate this tile',
  edit: 'Edit',
  editCollection: 'Edit collection',
  editDataCube: 'Edit data cube',
  editCluster: 'Edit cluster',
  editThisCube: 'Edit this cube',
  editTitleAndDesc: 'Edit title and description',
  editVisualization: 'Edit visualization',
  end: 'End',
  exclude: 'Exclude',
  explore: 'Explore',
  exportToCSV: 'Export to CSV',
  filter: 'Filter',
  filters: 'Filters',
  generalSettings: 'General settings',
  goToUrl: 'Go to URL',
  granularity: 'Granularity',
  home: 'Pivot',
  include: 'Include',
  infoAndFeedback: 'Info & Feedback',
  intersection: 'Intersection',
  last5Minutes: 'Last 5 minutes',
  lastDay: 'Last Day',
  lastHour: 'Last Hour',
  lastWeek: 'Last Week',
  latest: 'Latest',
  limit: 'Limit',
  logout: 'Logout',
  measures: 'Measures',
  measure: 'Measure',
  next: 'Next',
  no: 'No',
  noIllCreateThem: 'No, I\'ll create them myself',
  noClusters: 'There are no clusters connected',
  noDataCubes: 'There are no data cubes',
  noDescription: 'No description',
  noFilter: 'No filter',
  noTilesInThisCollection: 'There are no tiles in this collection',
  ok: 'OK',
  orAddASpecificAttribute: 'Or add a specific attribute',
  orViewSuggestedAttributes: 'Or view suggested attributes',
  openIn: 'Open in',
  pin: 'Pin',
  pinboard: 'Pinboard',
  pinboardPlaceholder: 'Click or drag dimensions to pin them',
  previous: 'Previous',
  queryError: 'Query error',
  quicklyAddSomeUsing: 'Quickly add some using',
  rawData: 'Raw Data',
  regex: 'Regex',
  removeAttribute: 'Remove attribute',
  relative: 'Relative',
  save: 'Save',
  segment: 'segment',
  select: 'Select',
  settings: 'Settings',
  sortBy: 'Sort by',
  specific: 'Specific',
  split: 'Split',
  splitDelimiter: 'by',
  start: 'Start',
  stringSearch: 'String search',
  subsplit: 'Split',
  subsetFilter: 'Subset Filter',
  suggestion: 'suggestion',
  suggestions: 'suggestions',
  timezone: 'Timezone',
  thereAreNoSuggestionsAtTheMoment: 'There are no suggestions at the moment',
  undo: 'Click here to undo',
  unsplitable: 'Un-splittable',
  updateTimezone: 'Update Timezone',
  viewRawData: 'View raw data',
  wouldYouLikeToCreateCubes: 'Would you like to create data cubes from them?',
  yes: 'Yes'
};

// Data cubes introspection strategies
export const DATA_CUBES_STRATEGIES_LABELS = {
  none: 'None',
  'no-autofill': 'No autofill',
  'autofill-dimensions-only': 'Autofill dimensions only',
  'autofill-measures-only': 'Autofill measures only',
  'autofill-all': 'Autofill all'
};


const EN_US: Locale = {
  shortDays: [ "S", "M", "T", "W", "T", "F", "S" ],
  shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" ],
  weekStart: 0
};

export function getLocale(): Locale {
  return EN_US;
}
